
#@layout()

#define css()
<!--全局样式-->
<style type="text/css">
    div {
        background-image: url(http://47.105.208.60:8080/wechat-api/images/loginbg.png);
        background-position: center center;
        background-repeat: no-repeat;
        background-attachment: fixed;
        background-size: cover;
    }

    form#index {
        margin-left: auto;
        margin-right: auto;
        max-width: 500px;
        background: #F7F7F7;
        opacity: 0.95;
        padding: 25px 15px 25px 10px;
        font: 12px Georgia, "Times New Roman", Times, serif;
        color: #888;
        text-shadow: 1px 1px 1px #FFF;
        border: 1px solid #E4E4E4;
        text-align: center;
    }

    form#index h3 {
        font-size: 25px;
        padding: 0px 0px 10px 40px;
        display: block;
        border-bottom: 1px solid #E4E4E4;
        margin: -10px -15px 30px -10px;;
        color: #888;
        text-align: center;
    }

    form#index label {
        display: block;
        margin: 0px;
    }

    form#index label > span {
        float: left;
        width: 20%;
        text-align: right;
        padding-right: 10px;
        margin-top: 10px;
        color: #888;
    }

    form#index input[type="text"], form#index input[type="number"] {
        border: 1px solid #DADADA;
        color: #888;
        height: 30px;
        margin-bottom: 16px;
        margin-right: 6px;
        margin-top: 2px;
        outline: 0 none;
        padding: 3px 3px 3px 5px;
        width: 70%;
        font-size: 12px;
        line-height: 15px;
        box-shadow: inset 0px 1px 4px #ECECEC;
        -moz-box-shadow: inset 0px 1px 4px #ECECEC;
        -webkit-box-shadow: inset 0px 1px 4px #ECECEC;
    }

    form#index .button {
        background: #E27575;
        border: none;
        padding: 10px 25px 10px 25px;
        color: #FFF;
        box-shadow: 1px 1px 5px #B6B6B6;
        border-radius: 3px;
        text-shadow: 1px 1px 1px #9E3F3F;
        cursor: pointer;
    }

    form#index label .container {
        width: 300px;
        height: 30px;
        background-color: greenyellow;
        margin-left: auto;
        margin-right: auto;

    }

    form#index label > span #progress {
        height: 20px;
        background-color: darkgray;
        display: inline-block;
        padding: 3px 0 0 0;
    }

</style>
#end

#define script()
<script>
    function chaxun() {
        var eid = document.getElementById("eid").value;

        $.ajax({
            url: "http://47.105.208.60:8080/wechat-api/rural/findByEid?eid=' + eid,
            //url: 'http://localhost:8080/wechat-api/rural/findByEid?eid=' + eid,
            //data:JSON.stringify($('form').serialize()),
            type: 'get',
            dataType: "json",
            xhrFields: {
                withCredentials: true
            },
            success: function (data) {
                if (data.code === 0) {
                    var msg = data.info;
                    if (msg != null && msg != "") {
                        window.location.href = "#(CPATH)/admin/manage/updateRural?id=" + msg.id;
                    } else {
                        window.location.href = "#(CPATH)/admin/manage/addRural?eid=" + eid;
                    }

                }
            },
            error: function (data) {
                alert(data.code);
            }
        });
    }
</script>
#end

#define content()
<div class="content-wrapper">
    <form id="index" onsubmit="return false" action="##" method="post">
        <h3 style="align-content: center">田园餐桌编号输入入口</h3>
        <label>
            <span>地理编号: </span>
            <input type="text" name="eid" class="eid" id="eid">
        </label>

        <input type="button" class="button" value="查询" onclick="chaxun()">
    </form>
</div>
#end

